package io.gitee.kotle.android.adapter

import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import java.lang.reflect.Type

/**
 *
 * 描述：Data必须唯一，是区分不同类型的标识
 *
 * 创建人：jiale.wei
 * 创建时间：2022/3/17 13:40
 *
 */
sealed class RecyclerRegisterInfo(var viewType: Int = RecyclerView.INVALID_TYPE) {
    class HolderClass<Data, Holder : RecyclerViewHolder<Data, *>>(
        var holderCls: Class<Holder>,
        viewType: Int = RecyclerView.INVALID_TYPE
    ) : RecyclerRegisterInfo(viewType)

    class HolderDataType<Data>(
        var dataClass: Class<Data>,
        viewType: Int = RecyclerView.INVALID_TYPE,
        var onCreateHolderListener: Function3<@ParameterName("inflater") LayoutInflater,
                @ParameterName("parent") ViewGroup,
                @ParameterName("viewType") Int,
                RecyclerViewHolder<Data, *>>
    ) : RecyclerRegisterInfo(viewType)
}